Skip to content

Conversation

@gregoryboudreau
Copy link
Contributor

@gregoryboudreau gregoryboudreau commented Aug 15, 2025

the or short circuits the evaluation if voltage updater returns True, this was raised as an issue on a comment on original PR, #600: #600 (comment)

if not (self.voltage_updater.update(self.stop_event) and self.current_updater.update(self.stop_event)):

We do want them to be chained such that if either returns False it will short circuit and not run the 2nd one (no point in running current updater if voltage receives a stop signal).

Description

Will now short circuit logic if voltage updater returns false (hit a stop signal) and exits functionality as long as either returns false, not if both return false.

Motivation and Context

Testing of #600 involved running manual validations to ensure that sending stop signals during execution was handled in a more timely pace. Was a miss.

How Has This Been Tested?

Reran sensormond daemon, this time through supervisorctl, and can see it coming up w/ voltage and chassis tables correctly.

root@MtFuji:/home/admin# show plat volt
                  Sensor    Voltage    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
------------------------  ---------  ---------  --------  --------------  -------------  ---------  -----------------
                 A1V2_BB    1208 mV       1320      1080            1320           1080      False  20250910 17:28:01
                 A1V8_BB    1813 mV       1980      1620            1980           1620      False  20250910 17:28:00
                  A1V_BB    1008 mV       1100       900            1100            900      False  20250910 17:28:00
                 A1V_CPU    1003 mV       1100       900            1100            900      False  20250910 17:27:45
               A1_2V_CPU    1208 mV       1320      1080            1320           1080      False  20250910 17:27:45
               A1_8V_CPU    1809 mV       1980      1620            1980           1620      False  20250910 17:27:44
               A2_5V_CPU    2506 mV       2750      2250            2750           2250      False  20250910 17:27:46
               A3P3V_CPU    3298 mV       3630      2970            3630           2970      False  20250910 17:27:46
                 A3V3_BB    3294 mV       3630      2970            3630           2970      False  20250910 17:28:01
                 F_P1_2V    1205 mV       1320      1068            1320           1068      False  20250910 17:28:02
                 F_P2_5V    2507 mV       2750      2225            2750           2225      False  20250910 17:28:02
                 F_P3_3V    3312 mV       3550      2937            3550           2937      False  20250910 17:28:02
                   F_P5V    5026 mV       5500      4450            5500           4450      False  20250910 17:28:01
                  F_P12V   12132 mV      14400      9600           14400           9600      False  20250910 17:28:03
       GB_CORE_VIN_L1_BB   12000 mV      14400      9600           14400           9600      False  20250910 17:27:59
.......
root@MtFuji:/home/admin# show plat curr
                 Sensor    Current    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
-----------------------  ---------  ---------  --------  --------------  -------------  ---------  -----------------
                   FAN0     448 mA      12500       400           16667            125      False  20250910 17:28:05
                   FAN1     385 mA      12500       400           16667            125       True  20250910 17:28:05
                   FAN2     358 mA      12500       400           16667            125       True  20250910 17:28:05
                   FAN3     404 mA      12500       400           16667            125      False  20250910 17:28:06
   GB_CORE_IINSEN_L1_BB   13125 mA      42905      5000           50000           5000      False  20250910 17:28:05
     GB_CORE_ISEN_L1_BB  174750 mA     450000     67000          465000          67000      False  20250910 17:28:05
         P12V_SLED1_IIN   12041 mA      17141         0           17141              0      False  20250910 17:28:04
         P12V_SLED2_IIN   11902 mA      17141         0           17141              0      False  20250910 17:28:04
         P12V_SLED3_IIN   11573 mA      17141         0           17141              0      False  20250910 17:28:04
         P12V_SLED4_IIN   11748 mA      17141         0           17141              0      False  20250910 17:28:04
 P12V_U1_VR3_IINSEN_CPU    3050 mA      13484      2000           13484           2000      False  20250910 17:28:04
 P12V_U1_VR4_IINSEN_CPU     147 mA       1117         4            1117              4      False  20250910 17:28:04
P12V_U1_VR5_IINSENS_CPU     442 mA       3963       313            3963            313      False  20250910 17:28:05
     TI_3V3_L_IINSEN_BB    1271 mA      18628         0           32640              0      False  20250910 17:28:05
    TI_3V3_L_ISEN_L1_BB    1281 mA      64350         0          112750              0      False  20250910 17:28:05
     TI_3V3_R_IINSEN_BB       0 mA      13947         0           30130              0      False  20250910 17:28:05
.......

Above is dump of voltage and current on a system w/ this change present.

Additional Information (Optional)

the or short circuits the evaluation if voltage updater returns True... I guess it should've been:
```
if not (self.voltage_updater.update(self.stop_event) and self.current_updater.update(self.stop_event)):
```
We do want them to be chained such that if either returns False it will short circuit and not run the 2nd one (no point in running current updater if voltage receives a stop signal).
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@gregoryboudreau
Copy link
Contributor Author

@prgeor @judyjoseph please help to review this, currently sensormond for current sensors is not working as expected without this

@rlhui rlhui requested a review from judyjoseph September 10, 2025 18:02
@abdosi
Copy link
Contributor

abdosi commented Oct 1, 2025

@gregoryboudreau : please make sure sonic-mgmt test case would have caught this issue.

@abdosi
Copy link
Contributor

abdosi commented Oct 1, 2025

@judyjoseph please help with sign-off

@spilkey-cisco
Copy link
Contributor

@abdosi @judyjoseph is anything else needed? show platform current doesn't work using master until this is fixed. It's been broken for months pending this PR.

@spilkey-cisco
Copy link
Contributor

@abdosi @judyjoseph is anything else needed? show platform current doesn't work using master until this is fixed. It's been broken for months pending this PR.

Really need this merged before 202511 is created.

Copy link
Contributor

@judyjoseph judyjoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@judyjoseph judyjoseph merged commit 9b8c568 into sonic-net:master Oct 23, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

8 participants